﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using Hydra.Shell.Interfaces;
using System.Windows;
using System.Windows.Input;
using Hydra.Shell.Enumerations;

namespace Hydra.Shell.Implementations
{
    public class HydraDocViewControl : ContentControl
    {
        public static readonly DependencyProperty DocViewProperty = DependencyProperty.Register("DocView", typeof(IDocumentView), typeof(HydraDocViewControl), new PropertyMetadata(DocViewChanged));
        private IDocumentView docView;

        private static void DocViewChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ((HydraDocViewControl)d).SetDocView((IDocumentView)e.NewValue);
        }

        private void SetDocView(IDocumentView docView)
        {
            this.docView = docView;
        }

        public IDocumentView DocView
        {
            get
            {
                return (IDocumentView)GetValue(DocViewProperty);
            }

            set
            {
                SetValue(DocViewProperty, value);
            }
        }
    }
}
